home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / contrib / gle.2.1 / include / GL / tube.h < prev   
Encoding:
C/C++ Source or Header  |  1995-07-05  |  6.8 KB  |  158 lines

  1. /* 
  2.  * Tubing and Extrusion header file.
  3.  * This file provides protypes and defines for the extrusion 
  4.  * and tubing primitives.
  5.  *
  6.  * Linas Vepstas 1991
  7.  */
  8.  
  9. #ifndef __TUBE_H__
  10. #define __TUBE_H__
  11.  
  12. /* some types */
  13. #define gleDouble double
  14. typedef gleDouble gleAffine[2][3];
  15.  
  16. /* defines for tubing join styles */
  17. #define TUBE_JN_RAW          0x1
  18. #define TUBE_JN_ANGLE        0x2
  19. #define TUBE_JN_CUT          0x3
  20. #define TUBE_JN_ROUND        0x4
  21. #define TUBE_JN_MASK         0xf    /* mask bits */
  22. #define TUBE_JN_CAP          0x10
  23.  
  24. /* determine how normal vectors are to be handled */
  25. #define TUBE_NORM_FACET      0x100
  26. #define TUBE_NORM_EDGE       0x200
  27. #define TUBE_NORM_PATH_EDGE  0x400 /* for spiral, lathe, helix primitives */
  28. #define TUBE_NORM_MASK       0xf00    /* mask bits */
  29.  
  30. /* closed or open countours */
  31. #define TUBE_CONTOUR_CLOSED    0x1000
  32.  
  33.  
  34. #ifdef GL_32
  35. /* HACK for GL 3.2 -- needed because no way to tell if lighting is on.  */
  36. #define TUBE_LIGHTING_ON    0x80000000
  37. #endif /* GL_32 */
  38.  
  39. /* append identifying prefix for OpenGL version */
  40. #if (defined OPENGL_10 || defined DEBUG_OPENGL_10)
  41.  
  42. #define extrusion    gleExtrusion
  43. #define setjoinstyle    gleSetJoinStyle
  44. #define getjoinstyle    gleGetJoinStyle
  45. #define polycone    glePolyCone
  46. #define polycylinder    glePolyCylinder
  47. #define    super_extrusion    gleSuperExtrusion
  48. #define    twist_extrusion    gleTwistExtrusion
  49. #define    spiral        gleSpiral
  50. #define    lathe        gleLathe
  51. #define    helicoid    gleHelicoid
  52.  
  53. #endif /* OPENGL_10 */
  54.  
  55.  
  56. #ifdef _NO_PROTO        /* NO ANSI C PROTOTYPING */
  57.  
  58. extern int getjoinstyle ();
  59. extern void setjoinstyle ();
  60. extern void polycone ();
  61. extern void polycylinder ();
  62. extern void extrusion ();
  63. extern void super_extrusion ();
  64. extern void twist_extrusion ();
  65. extern void spiral ();
  66. extern void lathe ();
  67. extern void helicoid ();
  68.  
  69. #else /* _NO_PROTO */        /* ANSI C PROTOTYPING */
  70.  
  71. extern int getjoinstyle (void);
  72. extern void setjoinstyle (int style);    /* bitwise OR of flags */
  73.  
  74. /* draw polyclinder, specified as a polyline */
  75. extern void polycylinder (int npoints,        /* num points in polyline */
  76.                    gleDouble point_array[][3],    /* polyline vertces */
  77.                    float color_array[][3],    /* colors at polyline verts */
  78.                    gleDouble radius);        /* radius of polycylinder */
  79.  
  80. /* draw polycone, specified as a polyline with radii */
  81. extern void polycone (int npoints,     /* numpoints in poly-line */
  82.                    gleDouble point_array[][3],    /* polyline vertices */
  83.                    float color_array[][3],    /* colors at polyline verts */
  84.                    gleDouble radius_array[]); /* cone radii at polyline verts */
  85.  
  86. /* extrude arbitrary 2D contour along arbitrary 3D path */
  87. extern void extrusion (int ncp,         /* number of contour points */
  88.                 gleDouble contour[][2],     /* 2D contour */
  89.                 gleDouble cont_normal[][2], /* 2D contour normals */
  90.                 gleDouble up[3],            /* up vector for contour */
  91.                 int npoints,            /* numpoints in poly-line */
  92.                 gleDouble point_array[][3], /* polyline vertices */
  93.                 float color_array[][3]); /* colors at polyline verts */
  94.  
  95. /* extrude 2D contour, specifying local rotations (twists) */
  96. extern void twist_extrusion (int ncp,         /* number of contour points */
  97.                 gleDouble contour[][2],    /* 2D contour */
  98.                 gleDouble cont_normal[][2], /* 2D contour normals */
  99.                 gleDouble up[3],           /* up vector for contour */
  100.                 int npoints,           /* numpoints in poly-line */
  101.                 gleDouble point_array[][3],        /* polyline vertices */
  102.                 float color_array[][3],        /* color at polyline verts */
  103.                 gleDouble twist_array[]);   /* countour twists (in degrees) */
  104.  
  105. /* extrude 2D contour, specifying local affine tranformations */
  106. extern void super_extrusion (int ncp,  /* number of contour points */
  107.                 gleDouble contour[][2],    /* 2D contour */
  108.                 gleDouble cont_normal[][2], /* 2D contour normals */
  109.                 gleDouble up[3],           /* up vector for contour */
  110.                 int npoints,           /* numpoints in poly-line */
  111.                 gleDouble point_array[][3],        /* polyline vertices */
  112.                 float color_array[][3],        /* color at polyline verts */
  113.                 gleDouble xform_array[][2][3]);   /* 2D contour xforms */
  114.  
  115. /* spiral moves contour along helical path by parallel transport */
  116. extern void spiral (int ncp,        /* number of contour points */
  117.              gleDouble contour[][2],    /* 2D contour */
  118.              gleDouble cont_normal[][2], /* 2D contour normals */
  119.              gleDouble up[3],           /* up vector for contour */
  120.              gleDouble startRadius,    /* spiral starts in x-y plane */
  121.              gleDouble drdTheta,        /* change in radius per revolution */
  122.              gleDouble startZ,        /* starting z value */
  123.              gleDouble dzdTheta,        /* change in Z per revolution */
  124.              gleDouble startXform[2][3], /* starting contour affine xform */
  125.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  126.              gleDouble startTheta,    /* start angle in x-y plane */
  127.              gleDouble sweepTheta);    /* degrees to spiral around */
  128.  
  129. /* lathe moves contour along helical path by helically shearing 3D space */
  130. extern void lathe (int ncp,        /* number of contour points */
  131.              gleDouble contour[][2],    /* 2D contour */
  132.              gleDouble cont_normal[][2], /* 2D contour normals */
  133.              gleDouble up[3],           /* up vector for contour */
  134.              gleDouble startRadius,    /* spiral starts in x-y plane */
  135.              gleDouble drdTheta,        /* change in radius per revolution */
  136.              gleDouble startZ,        /* starting z value */
  137.              gleDouble dzdTheta,        /* change in Z per revolution */
  138.              gleDouble startXform[2][3], /* starting contour affine xform */
  139.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  140.              gleDouble startTheta,    /* start angle in x-y plane */
  141.              gleDouble sweepTheta);    /* degrees to spiral around */
  142.  
  143. /* similar to spiral, except contour is a circle */
  144. extern void helicoid (gleDouble rToroid, /* circle contour (torus) radius */
  145.              gleDouble startRadius,    /* spiral starts in x-y plane */
  146.              gleDouble drdTheta,        /* change in radius per revolution */
  147.              gleDouble startZ,        /* starting z value */
  148.              gleDouble dzdTheta,        /* change in Z per revolution */
  149.              gleDouble startXform[2][3], /* starting contour affine xform */
  150.              gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
  151.              gleDouble startTheta,    /* start angle in x-y plane */
  152.              gleDouble sweepTheta);    /* degrees to spiral around */
  153.  
  154. #endif /*_NO_PROTO*/
  155.  
  156. #endif /*__TUBE_H__*/
  157. /* ================== END OF FILE ======================= */
  158.